import 'dart:convert';

import 'package:star_author/generated/json/base/json_field.dart';
import 'package:star_author/generated/json/notice_entity.g.dart';

@JsonSerializable()
class NoticeEntity {
  List<NoticeData>? data;
  bool? announcement_read;

  NoticeEntity();

  factory NoticeEntity.fromJson(Map<String, dynamic> json) =>
      $NoticeEntityFromJson(json);

  Map<String, dynamic> toJson() => $NoticeEntityToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
}

@JsonSerializable()
class NoticeData {
  int? id;
  String? body;
  bool? effective;
  String? created_at;

  NoticeData();

  factory NoticeData.fromJson(Map<String, dynamic> json) =>
      $NoticeDataFromJson(json);

  Map<String, dynamic> toJson() => $NoticeDataToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
}
